package com.ftg.learn.exam.util;

/**
 * @author KangJx
 * @date 2021/4/2
 */
public enum ErrorCode {
    /**
     * 10001 空指针
     * 10002 下标越界
     * 10003 运行时异常
     */

    NULLPOINTER{
        @Override
        public int getCode() {
            return 10001;
        }

        @Override
        public String getMsg() {
            return "kec:空指针异常";
        }
    },
    ARRAYINDEXOUTOF{
        @Override
        public int getCode() {
            return 10002;
        }

        @Override
        public String getMsg() {
            return "kec:数组下标越界";
        }
    },
    RuntimeException{
        @Override
        public int getCode() {
            return 10003;
        }

        @Override
        public String getMsg() {
            return "运行时异常";
        }
    };

    public abstract int getCode();
    public abstract String getMsg();

}
